import request from '@/utils/request'

// 查询图集标签列表
export function listProductAtlasTag(query) {
  return request({
    url: '/gather/gather/productAtlasTag/list',
    method: 'get',
    params: query
  })
}

// 查询图集标签详细
export function getProductAtlasTag(atlasTagId) {
  return request({
    url: '/gather/gather/productAtlasTag/' + atlasTagId,
    method: 'get'
  })
}

// 新增图集标签
export function addProductAtlasTag(data) {
  return request({
    url: '/gather/gather/productAtlasTag',
    method: 'post',
    data: data
  })
}

// 修改图集标签
export function updateProductAtlasTag(data) {
  return request({
    url: '/gather/gather/productAtlasTag',
    method: 'put',
    data: data
  })
}

// 删除图集标签
export function delProductAtlasTag(atlasTagId) {
  return request({
    url: '/gather/gather/productAtlasTag/' + atlasTagId,
    method: 'delete'
  })
}

// 删除图集标签
export function getTagList() {
  return request({
    url: '/gather/gather/productAtlasTag/getAllProductTag',
    method: 'get'
  })
}

// 新增图集
export function addProductAtlas(data) {
  return request({
    url: "/gather/gather/productAtlas/addProductAtlas",
    method: "post",
    data: data
  })
}

// 编辑产品图片
export function changePictureDetail(data) {
  return request({
    url: "/gather/gather/collectProductOptimize/addOptimizePic",
    method: "post",
    data: data
  })
}

// collectProductId 采集商品id
// 获取商品图片详情
export function getCollectProductImage(data) {
  return request({
    url: '/gather/gather/collectProductOptimize/getOptimizePicByCollectProductId',
    method: "get",
    params: data
  })
}

// 删除图片
export function deleteImage(data) {
  return request({
    url: '/gather/gather/productAtlas/' + data,
    method: "delete",
    // params: data
  })
}

export function getAtlasList(data) {
  return request({
    url: '/gather/gather/productAtlas/list',
    method: "get",
    params: data
  })
}

// 一键抠图
export function addToOptimizeTask(data) {
  return request({
    url: '/gather/collectProductOptimizeTask/addToOptimizeTask',
    method: "post",
    data: data
  })
}

// 分配任务
export function createPlanToHeadOptimize(data) {
  return request({
    url: '/system/collectProductOptimizePlan/createPlanToHeadOptimize',
    method: "post",
    data: data
  })
}

// 获取负责人信息
export function queryOptimizeHeadUser() {
  return request({
    url: '/system/collectProductOptimizePlan/queryOptimizeHeadUser',
    method: "get",
  })
}

// 查询美工主管分配任务列表
export function taskList(data) {
  return request({
    url: '/system/collectProductOptimizePlan/list',
    method: "get",
    params: data
  })
}

// 主管确认
export function supervisorReviewPass(data) {
  return request({
    url: '/system/collectProductOptimizePlan/supervisorReviewPass',
    method: "get",
    params: data
  })
}

// 主管要求重做
export function supervisorReviewRedo(data) {
  return request({
    url: '/system/collectProductOptimizePlan/supervisorReviewRedo',
    method: "get",
    params: data
  })
}

// 员工提交优化
export function headUserPostOptimize(data) {
  return request({
    url: '/system/collectProductOptimizePlan/headUserPostOptimize',
    method: "get",
    params: data
  })
}

// 查看当前用户角色
export function queryThisUserRole(data) {
  return request({
    url: '/system/collectProductOptimizePlan/queryThisUserRole',
    method: "get",
    params: data
  })
}

// 查看当前用户角色
export function userCollectProductList(data) {
  return request({
    url: '/system/collectProductOptimizePlan/userCollectProductList',
    method: "get",
    params: data
  })
}

// 阿里图片翻译
export function pictureEditor(data) {
  return request({
    url: '/gather/gather/pictureEditor',
    method: "get",
    params: data
  })
}

// 自定义多图优化
export function collectProductOptimize(data) {
  return request({
    url: '/gather/gather/collectProductOptimize/batchOptimization',
    method: "get",
    params: data
  })
}
